package com.mallcloud.mall.mall.api.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.util.List;
import java.util.Optional;

@ApiModel(value="ProPayCoupon",description="买券过程对象")
@Data
@ToString
public class ProPayCoupon {

	@ApiModelProperty("买券卡号")
	private String cardNo;
	@ApiModelProperty("档期编码")
	private String scheduleId;
	@ApiModelProperty("购券金额")
	private String payMoney;
	@ApiModelProperty("门店编号")
	private String storeNo;
	@ApiModelProperty("买券说明")
	private String memo;
	@ApiModelProperty("支付订单编号")
	private String payNo;
	@ApiModelProperty("券种类")
	private String type;
	@ApiModelProperty("购买数量")
	private String num;

	@ApiModelProperty(value = "执行状态", hidden = true)
	private Integer messageId;
	@ApiModelProperty(value = "执行提示信息", hidden = true)
	private String message;
	@ApiModelProperty(value = "积分记录表新id", hidden = true)
	private String recordId;
	@ApiModelProperty(value = "单据编号", hidden = true)
	List<ProPayCouponInfo> billNo;

	public boolean isSuccess() {
		return Optional.ofNullable(this.messageId).map(x -> x.equals(0)).orElse(false);
	}
}
